package week07

// 387. 字符串中的第一个唯一字符
// https://leetcode-cn.com/problems/first-unique-character-in-a-string/

func firstUniqChar(s string) int {
	var count = [26]int{}
	for i := range s {
		count[int(s[i]-'a')]++
	}
	for i := range s {
		if count[int(s[i]-'a')] == 1 {
			return i
		}
	}
	return -1
}
